package com.yanyan.sannuomin.exception;


import com.yanyan.sannuomin.result.ResultCode;

public class ResultException extends RuntimeException{

    /**
     * 错误码
     */
    protected String errorCode;
    /**
     * 错误信息
     */
    protected String errorMsg;

    public ResultException(){
        super();
    }

    public ResultException(ResultCode codeInfo){
        super(codeInfo.getResultCode());
        this.errorCode = codeInfo.getResultCode();
        this.errorMsg = codeInfo.getMassage();
    }

    public ResultException(String errorCode,String errorMsg){
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    @Override
    public Throwable fillInStackTrace() {
        return this;
    }
}
